/**
 * Created by admin on 2017/5/9.
 */
$(function(){
    var header = tool.header;
    header.public_key = localStorage.getItem("public_key");//获取公钥
    header.app_key = localStorage.getItem("app_key");//获取app标识
    header.source = localStorage.getItem("source");//用户来源
    header.client_id = localStorage.getItem("client_id");//用户手机唯一标识
    header.channel = localStorage.getItem("channel");//打包渠道
    header.app_version = localStorage.getItem("app_version");//APP版本号
    /*------------------------加载时获取服务器数据----------------------------------------*/
    function OnLoadInfo() {
        var flag = util.GetQueryString("flag");
        if (flag == 2) {
            var data = {
                user_id: util.GetQueryString("user_id")
            };
            var paramsStr = getparamsStr(data);
            var signaturesign = header.public_key + header.app_key + header.source + header.channel + header.client_id + header.app_version + paramsStr + header.timestamp;
            //签名信息MD5加密
            var signaturesignature = hex_md5(signaturesign);
            header.signature = signaturesignature;
            var urls = tool.httpsUrl + "";
            tool.ajax(urls, header, data, function (data) {
                console.log(data);
            });
        }else{
            util.loadScript("http://106.14.237.207/api-dqk/js/contact.js");
        }
    }
    OnLoadInfo();
});